import request from '@/utils/request'
import defaultSettings from '@/settings'

export function myselfTaskList(query) {
    return request({
      url: defaultSettings.serviceUrl.moon_fast + '/flowable/task/myselfTaskList',
      method: 'post',
      data: query
    })
  }

export function taskList(query) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/flowable/task/taskList',
    method: 'post',
    data: query
  })
}

//办结任务列表
export function completeProcessList(query) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/flowable/task/completeProcessList',
    method: 'post',
    data: query
  })
}

//保存到待发
export function startProcessInstanceById(query) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/flowable/task/startProcessInstanceByDeployId',
    method: 'post',
    data: query
  })
}

//启动流程并提交
export function startProcessInstanceAndSendTaskById(query) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/flowable/task/startProcessInstanceAndSendTaskById',
    method: 'post',
    data: query
  })
}

//从待发列表中提交流程
export function sendFirstTask(taskId) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/flowable/task/sendFirstTask?taskId=' +taskId,
    method: 'get'
  })
}


//签收
export function claimTask(taskId) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/flowable/task/claim-task?taskId=' +taskId,
    method: 'get'
  })
}


//审批任务
export function completeTask(query) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/flowable/task/complete-task',
    method: 'post',
    data: query
  })
}

//驳回
export function rejectTask(query) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/flowable/task/complete-task',
    method: 'post',
    data: query
  })
}